﻿namespace UFrame
{
    /// <summary>
    /// 代表框架每一个核心管理组件
    /// </summary>
    public interface IMa
    {
        bool IsInit { get; }

        void Release();
        void Init();
    }

    public abstract class MaMono<T> : SingletonMono<T>, IMa where T : class
    {
        protected bool isInit = false;

        public bool IsInit
        {
            get { return isInit; }
        }

        public virtual void Release()
        {

        }

        public virtual void Init()
        {
        }

        protected virtual void Awake()
        {
            base.Awake();
            isInit = true;
        }

        protected override void OnDestroy()
        {
            base.OnDestroy();
        }
    }


    public abstract class Ma<T> : Singleton<T>, IMa where T : class
    {
        protected bool isInit = false;

        public bool IsInit
        {
            get { return isInit; }
        }

        public virtual void Release()
        {
        }

        public virtual void Init()
        {
            isInit = true;
        }
    }
}